<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>报表统计首页</title>
  <link rel="stylesheet" href="https://cdn.staticfile.org/layui/2.9.7/css/layui.css">
</head>
<body>
<div class="layui-container">
  <h1 class="layui-header">报表统计首页</h1>
  <div class="layui-row layui-col-space20" id="reportContent"></div>
</div>

<script src="https://cdn.staticfile.org/jquery/3.6.0/jquery.min.js"></script>
<script src="https://cdn.staticfile.org/layui/2.9.7/layui.js"></script>
<script>
  $(document).ready(function(){
    var reports = [
      {name: '进货站报表', url: 'tostock_in_report'}, // 修改跳转链接
      {name: '出货站报表', url: 'tostock_out_report'}, // 修改跳转链接
      {name: '内部报表', url: 'tointernal_report'}, // 修改跳转链接
      {name: '收件统计', url: 'toreceipt_statistics'}, // 修改跳转链接
      {name: '派件统计', url: 'todispatch_statistics'} // 修改跳转链接
    ];


    var html = '';
    for(var i = 0; i < reports.length; i++){
      html += '<div class="layui-col-md4">';
      html += '<div class="layui-card">';
      html += '<div class="layui-card-header">' + reports[i].name + '</div>';
      html += '<div class="layui-card-body">';
      html += '<a href="#" class="layui-btn layui-btn-primary layui-btn-sm" onclick="redirectToPage(\'' + reports[i].url + '\')">查看报表</a>';
      html += '</div></div></div>';
    }
    $('#reportContent').html(html);
  });

  function redirectToPage(url) {
    window.location.href = url; // 使用 JavaScript 跳转页面
  }
</script>
</body>
</html>
